//
//  NumberSearchCell.m
//  ImGuider
//
//  Created by 王鹏宇 on 2017/7/25.
//  Copyright © 2017年 imguider. All rights reserved.
//

#import "NumberSearchCell.h"

@implementation NumberSearchCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
    _NameLabel.textColor = kSubitleColor;
    _NameLabel.font = Font(14);
    
    _officialNameLabel.textColor = kContentColor;
    _officialNameLabel.font = Font(12);
    _NumberLabel.textColor = kContentColor;
    _NumberLabel.font = Font(12);
    
    self.SerialNumberLabel.layer.cornerRadius = 10;
    self.SerialNumberLabel.clipsToBounds = YES;
    self.SerialNumberLabel.layer.borderWidth = 1.0f;
    self.SerialNumberLabel.layer.borderColor = [UIColor whiteColor].CGColor;
    self.SerialNumberLabel.hidden = YES;
}


- (void)configDataWith:(ScenicPoint *)scenic {
    
    self.NameLabel.text = scenic.spotname;
    
    if (scenic.ename.length >0) {
        
        self.officialNameLabel.text = [NSString localizedStringWithFormat:MYLocalizedString(@"SITEPLAY_SEARCH_NAME", nil),scenic.ename];
    }
    
    if (scenic.nodenumber.length > 0) {
        self.NumberLabel.text = [NSString localizedStringWithFormat:MYLocalizedString(@"SITEPLAY_SEARCH_ID", nil),scenic.nodenumber];
        self.NumberLabelH.constant = 22.5;
    }else {
        self.NumberLabel.text = @"";
        self.NumberLabelH.constant =0;
    }
    
    if (scenic.number.length > 0 && scenic.number.integerValue > 0) {
        self.SerialNumberLabel.text =  scenic.number;
        self.SerialNumberLabel.hidden = NO;
    }else {
        self.SerialNumberLabel.hidden = YES;
    }
    
    if (self.accessoryType != UITableViewCellAccessoryDisclosureIndicator) {
        self.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
    }
}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
